package net.nagaseyasuhito.nicola.service.impl;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import com.google.inject.Inject;

public abstract class BaseServiceImpl {
	@Inject
	protected EntityManager entityManager;

	protected Query createQuery(String query) {
		return this.entityManager.createQuery(query);
	}

	protected Query createQuery(String query, int firstResult, int maxResults) {
		return this.createQuery(query).setFirstResult(firstResult).setMaxResults(maxResults);
	}
}
